/*
 * display.h
 *
 * Created: 8/19/2013 5:57:53 PM
 *  Author: Ken Arok
 *
 * \brief LCD Character library.
 *
 * Copyright (c) 2013 PT Hanindo Automation Solutions. All rights reserved.
 *
 */

/** \section section_display_driver Display Driver
 * \brief This module describes how to user API library of the display.
*/


#ifndef DISPLAY_H_
#define DISPLAY_H_

#include "config_display.h"

#include "idefs.h"

#if DISPLAY_USED == DISPLAY_CHARACTER

/*! \defgroup DISPLAY_DRIVERS The Driver of Display
 * \{
 */

/** \brief Initialize LCD Display.
 * <pre><display.h></pre>
 * <pre>\b void \b vInitDisplay(void);</pre>
 */
extern void vInitDisplay(void);

/** \brief Set Display/Cursor position.
 * <pre><display.h></pre>
 * <pre>\b void \b vSetPositionDisplay(uint8_t _row, uint8_t _col);</pre>
 *
 * @param _row	Row position.
 * @param _col	Column position.
 *
 */
extern void vSetPositionDisplay(uint8_t _row, uint8_t _col);

/** \brief Put a character on the Screen.
 * <pre><display.h></pre>
 * <pre>\b void \b vPutDisplay(uint8_t _row, uint8_t _col, const char _char);</pre>
 *
 * @param _row	Row position.
 * @param _col	Column position.
 * @param _char	A character to be displayed.
 *
 */
extern void vPutDisplay(uint8_t _row, uint8_t _col, const char _char);

/** \brief Print a string character on the Screen.
 * <pre><display.h></pre>
 * <pre>\b void \b vPrintDisplay(uint8_t _row, uint8_t _col, const char *_string);</pre>
 *
 * @param _row		Row position.
 * @param _col		Column position.
 * @param _string	A string character to be displayed.
 *
 */
extern void vPrintDisplay(uint8_t _row, uint8_t _col, const char *_string);

/** \brief Clear screen.
 * <pre><display.h></pre>
 * <pre>\b void \b vClearDisplay(void);</pre>
 *
 */
extern void vClearDisplay(void);

/** \brief Control the LCD display.
 * <pre><display.h></pre>
 * <pre>\b void \b vControlDisplay(const uint8_t _ctrl);</pre>
 *
 * @param _ctrl		Control command.
 *
 */
extern void vControlDisplay(const uint8_t _ctrl);

/** \brief Turn LCD Back Light ON/OFF.
 * <pre><display.h></pre>
 * <pre>\b void \b vTurnBackLightDisplay(uint8_t _on_off, uint32_t _val);</pre>
 * @param _on_off	ON/OFF option.
 * <pre>iON = ON</pre>
 * <pre>iOFF = OFF</pre>
 * @param _val	Timer value in second. 0 means immediate.
 */
extern void vTurnBackLightDisplay(uint8_t _on_off, uint32_t _val);


#else /* DISPLAY_USED */

#define vInitDisplay()
#define vSetPositionDisplay(a, b)
#define vPutDisplay(a, b, c)
#define vPrintDisplay(a, b, c)
#define vClearDisplay()
#define vControlDisplay(a)
#define vTurnBackLightDisplay(a)


#endif /* DISPLAY_USED */


/**
 * \}
 */

#endif /* DISPLAY_H_ */
